<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreatePersonsTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="4">
                    <h:outputLabel value="#{bundle.CreatePersonsLabel_firstName}" for="firstName" />
                    <h:inputText id="firstName" value="#{personsController.selected.firstName}" title="#{bundle.CreatePersonsTitle_firstName}" />
                    <h:outputLabel value="#{bundle.CreatePersonsLabel_lastName}" for="lastName" />
                    <h:inputText id="lastName" value="#{personsController.selected.lastName}" title="#{bundle.CreatePersonsTitle_lastName}" />
                    <h:outputLabel value="#{bundle.CreatePersonsLabel_email}" for="email" />
                    <h:inputText id="email" value="#{personsController.selected.email}" title="#{bundle.CreatePersonsTitle_email}" />
                    <h:outputLabel value="#{bundle.CreatePersonsLabel_phoneNumber}" for="phoneNumber" />
                    <h:inputText id="phoneNumber" value="#{personsController.selected.phoneNumber}" title="#{bundle.CreatePersonsTitle_phoneNumber}" />
                    <h:outputLabel value="#{bundle.CreatePersonsLabel_street}" for="street" />
                    <h:inputText id="street" value="#{personsController.selected.street}" title="#{bundle.CreatePersonsTitle_street}" />
                    <h:outputLabel value="#{bundle.CreatePersonsLabel_address}" for="address" />
                    <h:inputText id="address" value="#{personsController.selected.address}" title="#{bundle.CreatePersonsTitle_address}" />
                    <h:outputLabel value="#{bundle.CreatePersonsLabel_city}" for="city" />
                    <h:inputText id="city" value="#{personsController.selected.city}" title="#{bundle.CreatePersonsTitle_city}" />
                    <h:outputLabel value="#{bundle.CreatePersonsLabel_postCode}" for="postCode" />
                    <h:inputText id="postCode" value="#{personsController.selected.postCode}" title="#{bundle.CreatePersonsTitle_postCode}" />
                    <h:outputLabel value="#{bundle.CreatePersonsLabel_login}" for="login" />
                    <h:inputText id="login" value="#{personsController.selected.login}" 
                                 title="#{bundle.CreatePersonsTitle_login}" required="true"
                                 label="#{bundle.CreatePersonsTitle_login}"/>
                    <h:outputLabel value="#{bundle.ViewPersonsLabel_password}" for="password" />
                    <h:inputSecret id="password" value="#{personsController.selected.password}" 
                                   title="#{bundle.ViewPersonsTitle_password}" required="true"
                                   label="#{bundle.ViewPersonsTitle_password}"/>
                    <h:outputLabel value="#{bundle.CreatePersonsLabel_personStatusId}" for="personStatusId" />
                    <h:selectOneMenu id="personStatusId" value="#{personsController.selected.personStatusId}" 
                                     title="#{bundle.CreatePersonsTitle_personStatusId}" required="true"
                                     label="#{bundle.CreatePersonsTitle_personStatusId}">
                        <f:selectItems value="#{personsController.statusItemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{personsController.create}" value="#{bundle.CreatePersonsSaveLink}"/>
                <br />
                <br />
                <h:commandLink action="#{personsController.prepareList}" value="#{bundle.CreatePersonsShowAllLink}" immediate="true"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
